package cn.wolfcode.wolf2w.repository;

import cn.wolfcode.wolf2w.domain.UserInfo;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户持久层接口 JPA规范
 */
@Repository
public interface UserInfoRepository  extends MongoRepository<UserInfo,String> {
    /**
     * 通过手机号码查询用户信息
     * @param phone
     * @return
     */
    UserInfo findByPhone(String phone);

    UserInfo findByPhoneAndPassword(String username, String password);

    List<UserInfo> findByCity(String keyword);
}
